package com.grupobbva.iici.util;

import javax.servlet.http.HttpServletRequest;

import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

public class SpringUtils {

	public static <T> T getBean(HttpServletRequest request,Class<T> clase){
		WebApplicationContext appContext = WebApplicationContextUtils.getWebApplicationContext(request.getSession().getServletContext());
		return (T)appContext.getBean(clase);	
	}
	
}
